---@class Table_CharModelItem
local Table_CharModelItem = class("Table_CharModelItem");

function Table_CharModelItem:ctor()
    self.Id = 0;    --唯一ID
    self.Name = "";    --名称
    self.ResPath = "";    --资源路径
    self.AnimPath = "";    --动作路径
    self.HeadPic = "";    --头像
    self.HeadInfoHeight = 0;    --头顶信息板高度修正
    self.Scale = 0;    --缩放比例
    self.DeadSound = 0;    --死亡音效
    self.ModelType = 0;    --骨骼模型类别
end

function Table_CharModelItem:Load(reader)
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.Id = tonumber(self.temp); end
    self.Name = reader:ReadString();
    self.ResPath = reader:ReadString();
    self.AnimPath = reader:ReadString();
    self.HeadPic = reader:ReadString();
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.HeadInfoHeight = tonumber(self.temp); end
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.Scale = tonumber(self.temp); end
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.DeadSound = tonumber(self.temp); end
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.ModelType = tonumber(self.temp); end
    self.temp = nil;
end

---@class Table_CharModelMgr : IDataMgr
local Table_CharModelMgr = class("Table_CharModelMgr", IDataMgr);

function Table_CharModelMgr:FileName()
    return "Txt/CharModel.txt";
end

---@return Table_CharModelItem
function Table_CharModelMgr:GetItemById(id)
    return self.super:GetItemById(id)
end

---@return Table_CharModelItem
function Table_CharModelMgr:GetItemByIdx(idx)
    return self.super:GetItemByIdx(idx)
end

function Table_CharModelMgr:Load(reader)
    local item = Table_CharModelItem.new();
    item:Load(reader);
    self.mItemDic[item.Id] = self.mDataCount;
    table.insert(self.mItemList, item);
end

return Table_CharModelMgr;